#pragma once
#ifndef _GAMEMINER_H_
#define _GAMEMINER_H_

#include "..\Engine\Core\Game.h"
#include "SDL.h"

#define MAX_FPS 30
#define GAME_TIME 60
#define FINISHED_TIME 5

//****** Forward Declarations ****
class CTimer;
class CBoard;
class CGUIText;
//*******************************

class CGameMiner: public CGame
{
private:
	typedef enum eGameState { GS_WAITING_TO_START = 0, GS_RUNNING, GS_PAUSED, GS_FINISHED };
	eGameState	m_eGameState;
	CTimer*		m_pfpsCounter;
	CTimer*		m_pFinishedCounter;
	bool		m_bfpsLimited;
	CBoard*		m_pBoard;
	CGUIText*	m_pGUITime;
	CGUIText*	m_pGUIScore;
	CGUIText*	m_pGUIEndScore;
	CGUIText*	m_pGUIStartInfo;
	CGUIText*	m_pGUIHighScore;
	CTimer*		m_pGameTime;
	int32		m_HighScore;

	void UpdateFPS();

public:
	CGameMiner();

	void Start();
	void Stop();

	void Init();	
	void ManageEvent(const SDL_Event* e);
	void Update();
	void Render();

	void LimiteFPS(bool fpsLimited){m_bfpsLimited = fpsLimited;}		
	bool IsFPSLimited() const {return m_bfpsLimited;}
};

#endif